Skip to content

Conversation

@333fred
Copy link
Member

@333fred 333fred commented Jun 8, 2025

This adds some basics for fetching and displaying notes from the server. Included is note counts display, and the ability to create notes. Actual display of notes will come next.

Note: based on #28, will rebase after that is merged.

@333fred
Copy link
Member Author

333fred commented Jun 8, 2025

Some screenshots:

image
image
image

@333fred
Copy link
Member Author

333fred commented Jun 8, 2025

image

Now with event note display

Copy link
Collaborator

@bherbst bherbst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great start - only thing I'd really like to see fixed before merging is the note type and state enum issue!

browserName = 'Firefox';
} else if (userAgent.includes('Safari') && !userAgent.includes('Chrome')) {
browserName = 'Safari';
} else if (userAgent.includes('Edg')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today I learned

Microsoft chose the Edg token to avoid compatibility issues caused by Edge string, which was previously used for the legacy Microsoft Edge browser based on EdgeHTML

Comment on lines +142 to +143
<!-- Match-specific fields -->
{#if noteType === 'match' || (noteType === 'team' && matchNumber)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm debating whether it makes more sense to split these out into different components or keep them together with shared saving logic. I think this is fine for now though, but I don't love the large if blocks (and somewhat murky state & component parameters since we need all of the possible pieces of state for all the possible note types defined)

}
</script>

<Modal bind:open={isOpen} {title}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future enhancement - the event note modal is awkwardly narrow on large screens

image

Comment on lines +161 to +176
<div>
<label
for="teamNumberInput"
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"
>
Team Number (optional)
</label>
<input
id="teamNumberInput"
type="number"
bind:value={teamNumber}
min="1"
class={styles.input.base}
placeholder="Leave blank for match-wide note"
/>
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is adding a match-level note with a team number something that we expect folks will want instead of just adding a note on that team in a match directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is something I expect to want. For example, recording that there was some sort of electrical failure in match 10.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or that some sensor miscounted.

Comment on lines +24 to +40
<div class="flex flex-wrap gap-2">
<span class="{styles.badge.base} {styles.badge.blue}">
{formatIssueType(note.issueType)}
</span>
<span
class="inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium {getStatusColor(
note.resolutionStatus
)}"
>
{formatResolutionStatus(note.resolutionStatus)}
</span>
{#if isMatchSpecific}
<span class="{styles.badge.base} {styles.badge.purple}">
Match {note.matchNumber}{note.playNumber ? `.${note.playNumber}` : ''}
</span>
{/if}
</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what exactly is going wrong yet but I'm always getting the open status here, even for notes I can see have a resolved status in the database.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for the issue type - maybe our enum deserialization just isn't working?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an FMS bug, not a bug with the app; it was fixed for the regular 2025 release, but I haven't made a new build with the requisite changes for us yet. We can ignore.

@333fred
Copy link
Member Author

333fred commented Jun 15, 2025

Pushed another change to deal with scaling on phones; things were being pushed too wide. We likely will need some more work there, possibly pushing the node count/add button to a new line, rather than keeping it on the same line as the team number.

@333fred 333fred merged commit 889617a into FIRST-Robotics-Competition:dev Jun 16, 2025
1 check passed
@333fred 333fred deleted the note-ui branch June 16, 2025 15:23
This was referenced Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants